/**
 * 
 */
package com.xb.demo17.observer;

/**
 * @author kexue
 *
 */
public class TestMain {

	public static void main(String[] args) {

		// Observer 多个
		Observer jdObserver = new JdObserver();
		Observer shopObserver = new TmallObserver2();

		// Subject 单个
		Subject subject = new Subject();

		// 注册观察者
		subject.addObserver(jdObserver);
		subject.addObserver(shopObserver);

		subject.setStatus(12); // 状态改变
	}
}
